package phoenix.core.base;

import phoenix.core.PhoenixManager;
import phoenix.core.config.extensions.ConfigExt;
import phoenix.core.data_models.extentions.TestDataModelExt;
import phoenix.core.helpers.HtmlHelper;
import phoenix.core.helpers.extensions.DBHelperExt;
import phoenix.core.helpers.extensions.LoggerHelperExt;
import core.helpers.BrowserHelper;
import core.helpers.CronosHelper;
import core.helpers.FileHelper;
import core.helpers.HarHelper;
import core.helpers.HttpHelper;
import core.helpers.JavaScriptHelper;
import core.helpers.ScreenLoggerHelper;
import core.helpers.StringHelper;
import core.helpers.XmlRpcHelper;

/**
 * The base class for all helpers.
 * Contains the link methods to other helpers
 */
public class HelperBase
{
	// PhoenixManager instance
	protected static PhoenixManager phoenix;

	/**
	 * Initializes HelperBase
	 * 
	 * @param p_manager ApplicationManager instance
	 */
	public HelperBase(PhoenixManager p_manager)
	{
		phoenix = p_manager;
	}

	/**
	 * Link method to TestModel
	 * 
	 * @return TestModel instance
	 */
	protected TestDataModelExt testModel()
	{
		return phoenix.testModel();
	}

	/**
	 * Link method to HttpHelper
	 * 
	 * @return HttpHelper instance
	 */
	protected HttpHelper http()
	{
		return phoenix.http();
	}

	/**
	 * Link method to FileHelper
	 * 
	 * @return FileHelper instance
	 */
	protected FileHelper file()
	{
		return phoenix.file();
	}

	/**
	 * Link method to HarHelper
	 * 
	 * @return HarHelper instance
	 */
	protected HarHelper har()
	{
		return phoenix.har();
	}

	/**
	 * @return DBHelper instance
	 */
	protected DBHelperExt db()
	{
		return phoenix.db();
	}

	/**
	 * Link method to BrowserHelper
	 * 
	 * @return BrowserHelper instance
	 */
	protected BrowserHelper browser()
	{
		return phoenix.browser();
	}

	/**
	 * Link method to CronosHelper
	 * 
	 * @return CronosHelper instance
	 */
	protected CronosHelper cronos()
	{
		return phoenix.cronos();
	}

	/**
	 * Link method to XmlRpcHelper
	 * 
	 * @return XmlRpcHelper instance
	 */
	protected XmlRpcHelper xmlRpc()
	{
		return phoenix.xmlRpc();
	}

	/**
	 * Link method to JavascriptExecutor
	 * 
	 * @return JavaScriptHelper instance
	 */
	protected JavaScriptHelper js()
	{
		return phoenix.js();
	}

	/**
	 * Link method to ScreenLoggerHelper
	 * 
	 * @return ScreenLoggerHelper instance
	 */
	protected ScreenLoggerHelper screenLogger()
	{
		return phoenix.screenLogger();
	}

	/**
	 * Link method to LoggerHelper
	 * 
	 * @return LoggerHelper instance
	 */
	public static LoggerHelperExt log()
	{
		return phoenix.log();
	}

	/**
	 * Link method to StringHelper
	 * 
	 * @return StringHelper instance
	 */
	public StringHelper string()
	{
		return phoenix.string();
	}

	/**
	 * Link method to ConfigExt
	 * 
	 * @return ConfigExt instance
	 */
	public ConfigExt config()
	{
		return phoenix.config();
	}

	public HtmlHelper html()
	{
		return phoenix.html();
	}

}
